@extends('layout.master')

@section('title','修改商铺类型')

@section('css')
@parent
<link href="{{ asset('plugins/bower_components/summernote/dist/summernote.css') }}" rel="stylesheet"/>
<!-- animation CSS -->
<link href="{{ asset('css/animate.css') }}" rel="stylesheet">
<link href="{{ asset('plugins/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
<link href="{{ asset('plugins/bower_components/bootstrap-switch/bootstrap-switch.min.css') }}" rel="stylesheet">
@endsection
@section('main')

@if (session('message'))
<div>
    <input type="hidden" id="hidden" name="hidden" value="hidden">
    <input type="hidden" id="message" name="message" value="{{ session('message') }}">
    <input type="hidden" id="status" name="status" value="{{ session('status') }}">
</div>
@endif

<div class="row">

    <div class="col-lg-12 col-md-12">
        <div class="white-box">
            <form class="form-horizontal form-material" id="publish" method="post" enctype="multipart/form-data">
                <div class="row">
                    <div class="col-md-12 col-sm-8">
                        <div class="row">
                            <div class="col-md-9 col-sm-6">
                                <div class="form-group">
                                    <label class="col-md-12">名称</label>
                                    <div class="col-md-12">
                                        <input type="text" name="store_type"
                                               value="{{ $type->store_type }}"
                                               class="form-control form-control-line">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-6">
                                <div class="form-group">
                                    <label class="col-md-12">排序</label>
                                    <div class="col-md-12">
                                        <input type="text" name="weight" value="{{ $type->weight }}"
                                               class="form-control form-control-line">
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-4 col-sm-6">
                                <div class="form-group">
                                    <label class="col-md-12">点击前</label>
                                    <div class="col-md-10">
                                        <div class="form-group ">
                                            <input type="file" id="input-file-now-custom-1" class="dropify"
                                                   name="pic"
                                                   data-height="200px"
                                                   data-default-file="{{ $type->pic }}"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-4 col-sm-6">
                                <div class="form-group">
                                    <label class="col-md-12">点击后</label>
                                    <div class="col-md-10">
                                        <div class="form-group ">
                                            <input type="file" id="input-file-now-custom-2" class="dropify"
                                                   name="act"
                                                   data-height="200px"
                                                   data-default-file="{{ $type->act }}"/>
                                        </div>
                                    </div>
                                </div>
                            </div>


                            <div class="col-md-4 col-sm-6">
                                <div class="form-group">
                                    <label class="col-md-12">大头针</label>
                                    <div class="col-md-10">
                                        <div class="form-group ">
                                            <input type="file" id="input-file-now-custom-3" class="dropify"
                                                   name="pin_pic"
                                                   data-height="200px"
                                                   data-default-file="{{ $type->pin_pic }}"/>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                        <div class="form-group">
                            <button class="fcbtn btn btn-success btn-outline btn-1e waves-effect">修改商铺类型
                            </button>
                            {!! csrf_field() !!}
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

@endsection
@section('js')
@parent
<!-- icheck -->
<script src="{{ asset('plugins/bower_components/icheck/icheck.min.js') }}"></script>
<script src="{{ asset('plugins/bower_components/icheck/icheck.init.js') }}"></script>
<script src="{{ asset('js/jasny-bootstrap.js') }}"></script>
<!-- jQuery file upload -->
<script src="{{ asset('plugins/bower_components/dropify/dist/js/dropify.min.js') }}"></script>
<script src="{{ asset('plugins/bower_components/summernote/dist/summernote.min.js') }}"></script>
<script>
    $(document).ready(function () {
        // Basic
        $('.dropify').dropify();
    });
</script>
<script src="{{ asset('plugins/bower_components/bootstrap-select/bootstrap-select.min.js') }}"
        type="text/javascript"></script>
<!-- bt-switch -->
<script src="{{ asset('plugins/bower_components/bootstrap-switch/bootstrap-switch.min.js') }}"></script>
<script type="text/javascript">

    jQuery(document).ready(function () {

        $('.summernote').summernote({
            height: 350, // set editor height
            minHeight: null, // set minimum height of editor
            maxHeight: null, // set maximum height of editor
            focus: false, // set focus to editable area after initializing summernote$('.summernote').summernote({
            toolbar: [
                // [groupName, [list of button]]
                ['style', ['bold', 'italic', 'underline', 'clear']],
                ['fontsize', ['fontsize']],
                ['fontname', ['fontname']],
                ['color', ['color']],
                ['para', ['ul', 'ol', 'paragraph']],
                ['height', ['height']],
                ['insert', ['link', 'picture', 'video']],
                ['view', ['fullscreen', 'codeview', 'help']]
            ],
            lang: 'zh-CN',
            // placeholder: '内容',
            dialogsFade: true,
        });

        $('.inline-editor').summernote({
            airMode: true
        });

    });

    $(".bt-switch input[type='checkbox'], .bt-switch input[type='radio']").bootstrapSwitch();
    var radioswitch = function () {
        var bt = function () {
            $(".radio-switch").on("switch-change", function () {
                $(".radio-switch").bootstrapSwitch("toggleRadioState")
            }),
                $(".radio-switch").on("switch-change", function () {
                    $(".radio-switch").bootstrapSwitch("toggleRadioStateAllowUncheck")
                }),
                $(".radio-switch").on("switch-change", function () {
                    $(".radio-switch").bootstrapSwitch("toggleRadioStateAllowUncheck", !1)
                })
        };
        return {
            init: function () {
                bt()
            }
        }
    }();
    $(document).ready(function () {
        radioswitch.init()
    });


    $(document).ready(function () {
        var hidden = $('#hidden').val();
        if (hidden === 'hidden') {
            if ($('#status').val() == 1) {
                toastsuccess($('#message').val());
            } else {
                toasterror($('#message').val());
            }
        }
    });

</script>
@endsection